From b8db48079f7716290464cbee9ae879c95d406c65 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Tue, 12 Jan 2016 21:37:27 +0100 Subject: [PATCH] switch: Fix text positioning https://bugzilla.gnome.org/show_bug.cgi?id=760509 --- gtk/gtkswitch.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gtk/gtkswitch.c b/gtk/gtkswitch.c index 9f6f6596ba..249753b457 100644 --- a/gtk/gtkswitch.c +++ b/gtk/gtkswitch.c @@ -624,8 +624,8 @@ gtk_switch_render_trough (GtkCssGadget *gadget, pango_layout_get_pixel_extents (layout, NULL, &rect); - label_x = ((width / 2) - rect.width) / 2; - label_y = (height - rect.height) / 2; + label_x = x + ((width / 2) - rect.width) / 2; + label_y = y + (height - rect.height) / 2; gtk_render_layout (context, cr, label_x, label_y, layout); @@ -638,8 +638,8 @@ gtk_switch_render_trough (GtkCssGadget *gadget, pango_layout_get_pixel_extents (layout, NULL, &rect); - label_x = (width / 2) + ((width / 2) - rect.width) / 2; - label_y = (height - rect.height) / 2; + label_x = x + (width / 2) + ((width / 2) - rect.width) / 2; + label_y = y + (height - rect.height) / 2; gtk_render_layout (context, cr, label_x, label_y, layout); -- 2.30.2